
package uestc.bitman.edxapp.units;

import java.util.ArrayList;
import java.util.List;

public class CourseUnit {

    private List<CourseBlock> mBlocks;

    private String mTitle;

    public CourseUnit() {
        mBlocks = new ArrayList<CourseBlock>();
    }

    public void appendBlock(CourseBlock block) {
        mBlocks.add(block);
    }

    public void setUnitTitle(String title) {
        mTitle = title;
    }

    public String getTitle() {
        return mTitle;
    }

    public void removeBlock(CourseBlock courseBlock) {
        mBlocks.remove(courseBlock);
    }

    public void removeBlock(int idx) {
        mBlocks.remove(idx);
    }

    public CourseBlock getCourseBlock(int idx) {
        return mBlocks.get(idx);
    }

    public int getBlocksCount() {
        return mBlocks.size();
    }

}
